<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta charset="utf-8" />
    <title>{$current['title']}-{$Think.CONFIG.title}</title>
    <meta name="keywords" content="{$Think.CONFIG.keywords}" />
    <meta name="description" content="{$Think.CONFIG.description}" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
    <include file="Public/head" />
</head>
<body class="no-skin">
<include file="Public/header" />
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try{ace.settings.check('main-container' , 'fixed')}catch(e){}
    </script>
    <include file="Public/sidebar" />
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs" />
            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set" />
                <!-- /section:settings.box -->

                <div class="row">
                    <div class="page-content">
						<div class="page-content-area">
							<div class="row">
								<div class="col-xs-12">
													<!-- PAGE CONTENT BEGINS -->

													<!--/span-->
													<!-- left menu ends -->
									<div style="margin-bottom: 10px;">
										<ul class="nav nav-tabs">
											<li class=""><a href="{:U('order')}<notempty name='uid'>/uid/{$uid}</notempty>">订单统计</a></li>
											<li class="active"><a href="{:U('members')}<notempty name='uid'>/uid/{$uid}</notempty>">用户统计</a></li>
											<li style="display: none" class=""><a href="{:U('order')}<notempty name='uid'>/uid/{$uid}</notempty>">小说统计</a></li>
										</ul>
									</div>
									<script>
									</script>

									<div class="row" id="member-summary-stats-panel">
										<div class="col-md-3">
											<div class="well">
												<b>
													今日新增
													<span style="font-weight:normal;font-size:13px;color:#090" class="pull-right">
														<!--<span class="refresh_seconds_left">59</span> 秒后刷新-->
													</span>
												</b>
												<div class="text-primary" style="font-size:32px;margin:5px 0">
													<span class="day_count">{$now_data['reg_user']|default='0'}人</span>
													<div style="font-size:13px;" class="text-muted">
														<b class="text-warning man">{$now_data['reg_man_user']|default='0'}</b> 男性,
														<b class="text-warning woman">{$now_data['reg_woman_user']|default='0'}</b> 女性,
														<b class="text-warning Unknown" title="用户未设置性别或未关注而无法获取性别">{$now_data['Unknown']|default='0'}</b> 未知
													</div>
												</div>
												<div>
													<div>
														已关注:
														<b class="text-warning">
															<span class="subscribe">{$now_data['subscribe']|default='0'}</span>(<span class="subscribe_ratio">{$now_data['subscribe_ratio']|default='0.00'}</span>%)人
														</b>
													</div>
													<div>
														已付费:
														<b class="text-warning">
															<span class="pay_num">{$now_data['pay_user']|default='0'}</span>(<span class="pay_ratio">{$now_data['pay_ratio']|default='0.00'}</span>%)人
														</b>
													</div>
												</div>
											</div>
										</div>

										<div class="col-md-3">
											<div class="well">
												<b>昨日新增</b>
												<div class="text-primary" style="font-size:32px;margin:5px 0">
													<span>{$data[$yesterday]['reg_user']|default='0'}人</span>
													<div style="font-size:13px;" class="text-muted">
														<b class="text-warning">{$data[$yesterday]['reg_man_user']|default='0'}</b> 男性,
														<b class="text-warning">{$data[$yesterday]['reg_woman_user']|default='0'}</b> 女性,
														<b class="text-warning" title="用户未设置性别或未关注而无法获取性别">{$data[$yesterday]['Unknown']|default='0'}</b> 未知
													</div>
												</div>
												<div>
													<div>
														已关注:
														<b class="text-warning">
															<span>{$data[$yesterday]['subscribe']|default='0'}</span>
															(<span>{$data[$yesterday]['subscribe_ratio']|default='0.00'}</span>%)人
														</b>
													</div>
													<div>
														已付费:
														<b class="text-warning">
															<span>{$data[$yesterday]['pay_user']|default='0'}</span>
															(<span>{$data[$yesterday]['pay_ratio']|default='0.00'}</span>%)人
														</b>
													</div>
												</div>
											</div>
										</div>

										<div class="col-md-3">
											<div class="well">
												<b>本月新增 (不含当日) <i class="fa fa-question-circle" title="不含当日，非实时，每天凌晨0左右更新"></i></b>
												<div class="text-primary" style="font-size:32px;margin:5px 0">
													<span>{$month_data['reg_user']|default='0'}人</span>
													<div style="font-size:13px;" class="text-muted">
														<b class="text-warning">{$month_data['reg_man_user']|default='0'}</b> 男性,
														<b class="text-warning">{$month_data['reg_woman_user']|default='0'}</b> 女性,
														<b class="text-warning" title="用户未设置性别或未关注而无法获取性别">{$month_data['Unknown']|default='0'}</b> 未知
													</div>
												</div>
												<div>
													<div>
														已关注:
														<b class="text-warning">
															<span>{$month_data['subscribe']|default='0'}</span>
															(<span>{$month_data['subscribe_ratio']|default='0.00'}</span>%)人
														</b>
													</div>
													<div>
														已付费:
														<b class="text-warning">
															<span>{$month_data['pay_user']|default='0'}</span>
															(<span>{$month_data['pay_ratio']|default='0.00'}</span>%)人
														</b>
													</div>
												</div>
											</div>
										</div>

										<div class="col-md-3">
											<div class="well">
												<b>所有时间 <i class="fa fa-question-circle" title="不含当日，非实时，每天凌晨0左右更新"></i></b>
												<div class="text-primary" style="font-size:32px;margin:5px 0">
													<span>{$count_data['reg_user']|default='0'}人</span>
													<div style="font-size:13px;" class="text-muted">
														<b class="text-warning">{$count_data['reg_man_user']|default='0'}</b> 男性,
														<b class="text-warning">{$count_data['reg_woman_user']|default='0'}</b> 女性,
														<b class="text-warning" title="用户未设置性别或未关注而无法获取性别">{$count_data['Unknown']|default='0'}</b> 未知
													</div>
												</div>
												<div>
													<div>
														已关注:
														<b class="text-warning">
															<span>{$count_data['subscribe']|default='0'}</span>
															(<span>{$count_data['subscribe_ratio']|default='0.00'}</span>%)人
														</b>
													</div>
													<div>
														已付费:
														<b class="text-warning">
															<span>{$count_data['pay_user']|default='0'}</span>
															(<span>{$count_data['pay_ratio']|default='0.00'}</span>%)人
														</b>
													</div>
												</div>
											</div>
										</div>
									</div>
									<div class="panel panel-default" id="member-daily-stats-panel">
										<div class="panel-heading">
											<h3 class="panel-title"><i class="fa fa-calendar"></i> 近30天用户统计</h3>
										</div>
										<div class="loading-panel" style="display: none;">
											<i class="fa fa-spinner fa-spin"></i>
										</div>
										<table class="table table-bordered table-striped">
											<thead>
												<tr>
													<th>日期</th>
													<th class="text-right">新增用户</th>
													<th class="text-right">已关注</th>
													<th class="text-right">已付费</th>
													<th class="text-right">男性</th>
													<th class="text-right">女性</th>
												</tr>
											</thead>
											<tbody data-bind="foreach: stats">
												<volist name="data" id="val">
												<tr>
													<td>
														<span>{$key}</span>
													</td>
													<td class="text-right">
														<span>{$val['reg_user']|default='0'}人</span>
													</td>
													<td class="text-right">
														<span>{$val['subscribe']|default='0'}人</span>
													</td>
													<td class="text-right">
														<span>{$val['pay_user']|default='0'}人</span>
													</td>
													<td class="text-right">
														<span>{$val['reg_man_user']|default='0'}人</span>
													</td>
													<td class="text-right">
														<span>{$val['reg_woman_user']|default='0'}人</span>
													</td>
												</tr>
												</volist>
											</tbody>
										</table>
									</div>
									<!-- PAGE CONTENT ENDS -->
								</div>
							</div><!-- /.row -->
						</div><!-- /.page-content-area -->
					</div>
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer" />
</div><!-- /.main-container -->
<include file="Public/footerjs" />
<!-- inline scripts related to this page -->
<script src="__PUBLIC__/qwadmin/js/date-time/bootstrap-datepicker.js"></script>
<script type="text/javascript">
	var uid = '{$uid}';
    var time = 60;
	$(function () {
		$('.date_keyword').datepicker({
            format: 'yyyy-mm-dd',
            weekStart: 1,
            autoclose: true,
            todayBtn: 'linked',
            language: 'cn'
        });
		refresh();
	});
	
	function refresh(){
	return;
		time--;
		$('.refresh_seconds_left').html(time);
		if(time==0){
			time = 60;
			$.post("{:U('day_members')}" , {uid :uid} , function(data){
				$('.day_count').html(data.count);
				$('.man').html(data.man);
				$('.woman').html(data.woman);
				$('.Unknown').html(data.Unknown);
				$('.subscribe').html(data.subscribe);
				$('.subscribe_ratio').html(data.subscribe_ratio);
				$('.pay_num').html(data.pay_num);
				$('.pay_ratio').html(data.pay_ratio);
			},'json');
		}
		setTimeout(refresh,1000);
	}
</script>
</body>
</html>